# coding=utf-8

import re


def get_logs(filetxt):
    result = re.findall(pattern, filetxt)
    seltxt = result[0]
    if "ORA-" in seltxt or "Errors" in seltxt or "error" in seltxt or "TNS-" in seltxt:
        print()


def get_time(week, tmp_file):
    time = []
    for line in tmp_file:
        tmp_line = line.split()
        lens = len(tmp_line)
        # print(lens)
        if lens > 3:
            if tmp_line[0] in week[:]:
                time.append(line.strip())
    return time


if __name__ == '__main__':
    logfile = r'E:\OracleEnv\diag\tnslsnr\T440P\listener\trace\listener.log'
    week = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']
    file = open(logfile)
    filelines = file.readlines()
    print(filelines)
